<%-- 
    Document   : modifyProduct
    Created on : 2011-5-22, 10:21:29
    Author     : tecton
--%>

<%@page import="com.dairy.structures.Company"%>
<%@page import="com.dairy.structures.Dairyproduct"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<%
    Dairyproduct product = (Dairyproduct)request.getAttribute("product");
%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript">
        function submit(){
            document.forms["ProductModifyForm"].submit();
        }
    </script>
    <title>订奶系统</title>
    <link rel="stylesheet" type="text/css" href="./home_style.css"/>
</head>

<body>
    <div class="wrapper">
        <div class="header">
            <h1>Modify Product Page</h1>
        </div>

        <div class="content">

            <div class="primary">
                <% Object success = request.getAttribute("success");
                    if (success != null)
                    {
                    String suc = success.toString();
                    if (suc.equals("true")){
                %>
                <h1>modification succeeded</h1>
                <%
                    }else{
                %>
                <h1>modification failed</h1>
                <%
                }}
                %>
                <html:form action="/modifyProduct" method="POST">
                    <br/>
                    <table>
                        <tr>
                            <td style="width:150px" height="30px">
                                <label>Product Name:</label>
                            </td>
                            <td>
                                <input type="text" name="name" id="name"
                           value="<%=product.name%>" />
                            </td>
                        </tr>
                        <tr>
                            <td height="30px">
                                <label>Company:</label>
                            </td>
                            <td>
                                <%=product.company%>
                            </td>
                        </tr>
                        <tr>
                            <td height="30px">
                                <label>Category:</label>
                            </td>
                            <td>
                                <input type="text" name="category" id="category"
                           value="<%=product.category%>" />
                            </td>
                        </tr>
                        <tr>
                            <td height="30px">
                                <label>Property:</label>
                            </td>
                            <td>
                                <input type="text" name="property" id="property"
                           value="<%=product.property%>" />
                            </td>
                        </tr>
                        <tr>
                            <td height="30px">
                                <label>Price:</label>
                            </td>
                            <td>
                                <input type="text" name="price" id="price"
                           value="<%=product.price%>" />
                            </td>
                        </tr>
                        <tr>
                            <td height="30px">
                                <button type="submit" name="modify" onclick="javascript:submitForm()">Modify</button>
                            </td>
                        </tr>
                    </table>
                            
<!--                    <label>product name:</label><br /><br />
                    <input type="text" name="name" id="name"
                           value="<%=product.name%>" /><br /><br />
                    <label>company name:</label><br /><br />
                    <input type="text" name="company" id="company"
                           value="<%=product.company%>" /><br /><br />
                    <label>category:</label><br /><br />
                    <input type="text" name="category" id="category"
                           value="<%=product.category%>" /><br /><br />
                    <label>property:</label><br /><br />
                    <input type="text" name="property" id="property"
                           value="<%=product.property%>" /><br /><br />
                    <label>price:</label><br /><br />
                    <input type="text" name="price" id="price"
                           value="<%=product.price%>" /><br /><br />
                    <button type="submit" name="modify"
                            onclick="javascript:submit()">Modify</button>-->
                </html:form>
            </div>

            <div class="secondary">
                <ul class="nav">
                    <li class="first"><a href="admin/index.do">Home</a></li>
                    <li><a href="./logout.do">logout</a></li>
                    <li><a href="./dispatchOrders.do">Dispatch Orders</a></li>
                    <li><a href="./modifyCompany.do">company information</a></li>
                    <li><a href="./viewProduct.do">view products</a></li>
                    <li><a href="./viewProduct.do">modify products</a></li>
                </ul>

            </div>

        </div>

        <div class="footer">
            <p>Dairy Product Ordering System - All Rights Reserved</p>
        </div>
    </div>
</body>
</html>